/**
 * Created by dell on 2016/11/6.
 */
for(var  i=1;i<=$('input.file').length;i++){
    $("#file-"+i).fileinput({
        uploadUrl: 'fileupload',
        language: 'zh',
        allowedFileExtensions : ['jpg', 'png','gif'],
        showUpload: false,
        showCaption: false,
        overwriteInitial: false,
        maxImageWidth: 400,
        showRemove:false,
        maxImageHeight: 200,
        maxFileSize: 200,
        dropZoneEnabled: false,
        maxFileCount: 2,
        showClose : false,
        msgFilesTooMany: "只能上传{m}张图片！",
        slugCallback: function(filename) {
            return filename.replace('(', '_').replace(']', '_');
        },
    }).on('change',function(){
        //发生改变执行

    }).on("filebatchselected",function(){
        //选择完成执行
        $('.kv-file-upload').hide();
        $('.file-upload-indicator').hide();
        $('.file-footer-buttons button.kv-file-remove').on('click',function(){
            //点击删除按钮事件
        })
    });
}
    $('#BankAddressSct').citySelect(
    {
        required:false,
        nodata:'none',
    }
);


//验证
$(function(){
    var e = "<i class='fa fa-minus-circle'  style='font-size: 18px;padding-left: 5px;padding-top: 5px'></i> ";
    $('#BankForm').validate({
        submitHandler:function(){
            alert('提交成功')
            //设置跳转
            $('.btnNext').attr('href','locateStoreInfo.html');
        },
        rules:{
            TaxpayersType:{
                required:true,
            },
            taxTypeTaxCode:{
                required:true,
            },
            taxIdentityNum:{
                required:true,
            },
            companyBankAcc:{
                required:true,
            },
            bankBrName:{
                required:true,
            },
            BankBranchNumber:{
                required:true,
            },
            bankCity:{
                required:true,
            }
        },
        messages:{
            TaxpayersType:{
                required:e+'请选择纳税人类型',
            },
            taxTypeTaxCode:{
                required:e+'请选择纳税类型税码',
            },
            taxIdentityNum:{
                required:e+'请输入纳税人识别号',
            },
            companyBankAcc:{
                required:e+'请输入公司银行账号'
            },
            bankBrName:{
                required:e+'请输入开户银行支行名称'
            },
            BankBranchNumber:{
                required:e+'请输入开户银行支行联行号'
            },
            bankCity:{
                required:e+'请选择开户银行所在地'
            }
        },
        errorPlacement: function(error, element) { //错误信息位置设置方法
            element.parent().append(error);
        },
    })
})
$('.btnNext').on('click',function(){
    $('.BankSubmit').trigger('click');
})
function regsb(){

}
